from django.shortcuts import render_to_response
from django.shortcuts import get_object_or_404
from apps.jblog.models import Entry
from apps.simplecomment.forms import SubmitComment
from apps.simplecomment.utils import RelatedComments

def blog_entry(request, slug):
    entry = get_object_or_404(Entry, slug=slug)
    comments = RelatedComments(entry)
    comment_form = SubmitComment(model=entry, request=request)
    return render_to_response("blog.html", {'request': request, 'entry': entry, 'comments': comments, 'comment_form': comment_form, })
